package com.classtimer.controller;

import com.classtimer.Model.StudentInfo;
import com.jfinal.core.Controller;

public class IndexController extends Controller {

	public void index() {
		render("query.html");
	}

	public void getData() {

		String stunum = getPara("stunum");
		String password = getPara("password");
		
		 StudentInfo studentInfo = StudentInfo.dao.findStudentByStunum(stunum);
		 if(studentInfo !=null) {
			 if(password.equals(studentInfo.getPassword())) {
				  setAttr("studentInfo", studentInfo);
				  renderJson();
			 }else {
				  renderText("密码错误");
			 }
		 }else {
		 	  renderText("无此用户，请联系你的导生大大");
		 }
	}
}
